<?php

namespace App\Services;

use App\Models\User;
use Illuminate\Database\Eloquent\Model;

class UserService
{
    /**
     * Store user.
     * @param array $params
     * @return User|Model
     */
    public static function storeUser(array $params): Model|User
    {
        return User::query()->create($params);
    }

    /**
     * Get user by phone.
     * @param string $phone
     * @return User|null
     */
    public static function getUserByPhone(string $phone): ?User
    {
        return User::query()->where('phone', $phone)->first();
    }
}
